package eg
{

    // Copyright (c) 2002 Cunningham & Cunningham, Inc.
    // Released under the terms of the GNU General Public License version 2 or later.

import com.fit4as.fit.*;

public class ArithmeticFixture extends PrimitiveFixture {

    private var x : int = 0;
    private var y : int = 0;

    override public function doRows(rows : Parse) : void {
        super.doRows(rows.more);    // skip column heads
    }

    override public function doCell(cell : Parse, column : int) : void {
        //t race( int.MAX_VALUE, int( 1000000 * 1000000 ), cell.text(), int( x * y ));
        switch (column) {
            case 0: x = parseLong(cell); break;
            case 1: y = parseLong(cell); break;
            case 2: checkLong(cell, int(x + y)); break;
            case 3: checkLong(cell, int(x - y)); break;
            case 4: checkLong(cell, int(x * y)); break;
            case 5: if (y == 0) throw new Exception("Division by Zero"); checkLong(cell, int(x / y)); break;
        }
		ignore(cell);        
    }
}
}